package com.zlp.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 供应商类型
 * @author ZouLiPing
 * @date 2022/8/17 10:27
 */
@Getter
@AllArgsConstructor
public enum CouponTypeEnum {

    NON("非供应商商品",1000, Arrays.asList("A,B")),
    LI_HAN("力翰",2000,Arrays.asList("B,C,D")),

    YUNSHENG_FUTURE("云生未来",3000,Arrays.asList("A,C,D"))
    ;
    private String name;
    private Integer code;

    /**
     *  公司
     */
    private List<String> companyList;





    /**
     * 根据code获取name
     */
    public static List<String> getCompanyList(Integer code) {
        for (CouponTypeEnum supplierTypeEnum : CouponTypeEnum.values()) {
            if (supplierTypeEnum.getCode().equals(code)) {
                return supplierTypeEnum.getCompanyList();
            }
        }
        return new ArrayList<>();
    }

}